value = []

with open("in.txt", "r+") as content:
    for item in content.readlines():
        result = []
        item = item.replace("\n", "")
        item = item.replace("\t", " ")
        ls = item.split(" ")
        lnum = []
        for string in ls:
            if string !="":
                lnum.append(eval(string))

        result.append(max(lnum))
        result.append(min(lnum))
        value.append(result)

with open("out.txt", "w+") as result:
    for item in value:
        if item[0] != "":
            result.writelines(str(item[0]) + "  " + str(item[1]) + "\n")
